import base from './base'; // 导入接口域名列表
import axios from '@/request/httpRequest'; // 导入http中创建的axios实例
// 关于转义：http://www.jsons.cn/urlencode
// import qs from 'qs'; // 根据需求是否导入qs模块

const commit = {
	IndexShops(params) {
		return axios.post(`${base.sqq}/api/index/pc_index_shops`, { shop_ids: params.shop_ids });
	},
	ShopsShow(params) {
		return axios.post(`${base.sqq}/api/index/shop_detail`, { shop_id: params.shop_id });
	},

	ShopMenu(params) {
		return axios.post(`${base.sqq}/api/index/shop_menu`, { shop_id: params.shop_id });
	},
	ShopCateGory(params) {
		return axios.post(`${base.sqq}/api/index/shopCategory`, { shop_id: params.shop_id })
	},
	ShopIndex(params) {
		return axios.post(`${base.sqq}/api/index/shop_index`, { shop_id: params.shop_id })
	},
	// 优惠券
	UapiAction(params) {
		return axios.post(`${base.sqq}/api/score/uApi/action?action=${params.action}`, params)
	},
	// 领取优惠券/api/score/uApi?action={$action}
	ToReceiveUapiAction(params) {
		return axios.post(`${base.sqq}/api/score/uApi?action=${params.action}&access_token=${params.token}`, params)
	},
	// 店铺所属商品总数统计查询接口
	GetProductList(params) {
		return axios.post(`${base.sq}/client/Products/getProductList?size=M&terminaltype=PC`, params);
	},
	// 用户关注店铺总数查询client/ShopFavorites/getShopFavorites
	GetShopFavorites(params) {
		return axios.post(`${base.sq}/client/ShopFavorites/getShopFavorites?size=M&terminaltype=PC&token=${params.token}`, params)
	},
	// 店铺关注用户总数查询client/ShopFavorites/getShopFavorites
	getFavoriteCount(params) {
		return axios.post(`${base.sq}/client/ShopFavorites/getFavoriteCount?size=M&terminaltype=PC&token=${params.token}`, params)
	},


	// 店铺属于自营还是非自营 client/Shops/getShopsByCondition
	GetShopsByCondition(params) {
		return axios.post(`${base.sq}/client/Shops/getShopsByCondition?size=M&terminaltype=PC&action=${params.token}`, params)
	},
	// 店铺成交订单总数统计查询接口client/Orders/getShopOrderVolume
	GetShopOrderVolume(params) {
		return axios.post(`${base.sq}/client/Orders/getShopOrderVolume?size=M&terminaltype=PC`, params)
	},
	// 店铺详情/Shops/getShopById
	GetShopById(params) {
		return axios.post(`${base.sq}/client/Shops/getShopById?size=M&terminaltype=PC`, params)
	},
	// 店铺关注/client/ShopFavorites/addShopFavorite?size=M&terminaltype=Mobile&token=cc5083ef56784bc28ba66f5cc9fddee2
	GetAddShopFavorite(params) {
		return axios.post(`${base.sq}/client/ShopFavorites/addShopFavorite?size=M&terminaltype=PC&token=${params.token}`, params)
	},
	// 取消关注/client/ShopFavorites/delFavorites?size=M&terminaltype=Mobile&token=cc5083ef56784bc28ba66f5cc9fddee2
	delFavorites(params) {
		return axios.post(`${base.sq}/client/ShopFavorites/delFavorites?size=M&terminaltype=PC&token=${params.token}`, params)
	},
	// 热销商品/api/index/shopHotGoods
	GetShopHotGoods(params) {
		return axios.post(`${base.sqq}/api/index/shopHotGoods`, params)
	},

	// 活动楼层 /api/index/shopActive
	GetShopActive(params) {
		return axios.post(`${base.sqq}/api/index/shopActive`, params)
	},

	//商品列表
	getProductList(params) {
		return axios.post(`${base.sq}/client/Products/getProductList?size=M&terminaltype=PC&token=${params.token}`, params);
	},

	// 店铺top单品client/Orders/getProductMainTopList?size=M&terminaltype=PC
	GetProductMainTopListAPI(params) {
		return axios.post(`${base.sq}/client/Orders/getProductMainTopList?size=M&terminaltype=PC&token=${params.token}`, params);
	},

	// 店铺新品
	GetShopNewGoods(params) {
		return axios.post(`${base.sqq}api/index/shopNewGoods`, params)
	},
	// 店铺其他活动 api/PricePreferentialService/getPricePreferentialList
	// 文档：http://uhyapi.yonyouup.com/showdocmysql/index.php?s=/page/285
	getPricePreferentialList(params) {
		return axios.post(`${base.sqq}api/admin/getPricePreferentialList?size=M&terminaltype=PC`, params.data)
	},

	// 反馈分类
	BackCategory() {
		return axios.post(`${base.sqq}/api/index/backCategory`);
	},
	// 提交反馈index/feedback
	FeedbackApi(params) {
		return axios.post(`${base.sqq}api/index/feedback`, params)
	}
	
}

export default commit;